﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using TarreOA.TarreOADAL;

public partial class DiscussArea_DelCom : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(Request.QueryString.Get("TCID") != null && Request.QueryString.Get("TID") != null)
        {
            SqlConnection sqlConn = SQLManager.GetConn();
            sqlConn.Open();
            string sql = "delete from DiscussThemeComments where DtCommentsId = " + int.Parse(Request.QueryString.Get("TCID"));
            SqlCommand sqlCmd = new SqlCommand(sql, sqlConn);
            sqlCmd.ExecuteNonQuery();
            sqlConn.Close();
            sqlConn.Dispose();
            Response.Redirect("ThemeAppear.aspx?dt_id=" + int.Parse(Request.QueryString.Get("TID")));
        }
    }
}
